define(['jquery'],()=> {
  class Footer {
    constructor () {
      this.load().then(()=> {
        this.zhiding()
      })
    }
    load () {
      return new Promise(resolve => {
        $("footer").load('/html/modules/footer.html',resolve)
    })
    }
    zhiding () {
      document.onscroll = function () {
        var top = document.documentElement.scrollTop
        if(top>= 1000) {
              $('.huidaodingbu').css('display','block')
              $('.huidaodingbu').css('position','fixed')
              $('.huidaodingbu').css('right','20px')
              $('.huidaodingbu').css('bottom','20px')
            }else {
              $('.huidaodingbu').css('display','none')
            }
          }
          $('.huidaodingbu').hover(function(){
            $('.huidaodingbu a i').css('display','none')
            $('.huidaodingbu a span').css('display','block')
            $('.huidaodingbu').css("background-color","purple")
        },function(){
            $('.huidaodingbu a i').css('display','block')
            $('.huidaodingbu a span').css('display','none')
            $('.huidaodingbu').css("background-color","#fff")
        })  
        $('huidaodingbu').on('click',(e) => {
          document.documentElement.scrollTop = 0
          e.preventdefault()
        })
     }

  }
  return new Footer()
})